package cn.edu.scau.cmi.mazhuanglong.esercise9.homework;

import java.util.*;

public class ComputePice {
	double compute(String s, String fenge) {
		StringTokenizer fenxiOne = new StringTokenizer(s, fenge);
		double sum = 0;
		double digitItem=0;
		while(fenxiOne.hasMoreTokens()) {
			String str=fenxiOne.nextToken();
			digitItem=Double.parseDouble(str);
			sum=sum+digitItem;
		}
		return sum;
	}
}
